//---------------------------------------------------------------------------
class ArgContainer;
#ifndef utilsH
#define utilsH
//---------------------------------------------------------------------------
#include <windows.h>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <stdio.h>
using namespace std;
#include "structs.h"
//#include "Player_Window.h"
#include "servercontrol.h"
#include "commands.h"
#define PI 3.141592653589793f
#define BAD_LOC D3DXVECTOR3((float)INFINITE,(float)INFINITE,(float)INFINITE)

#define ABSVALUE(val) if(val<0) val*=-1;
#define TOGGLE(val, on) val = (on==-1 ? !val : on)

//DWORD SAPPCHANDLER;
// (Taken from Termy's SAPP source
//void (*Print)(int r,char *text,...) = (void(*)(int,char*,...))0x004b3800;

//void ( __cdecl *ExecuteCommand)(const char *cmd) = ( void(__cdecl*)(const char*) ) 0x0047EA20;
string ToStr(int number);
string ToStr(double number);
bool isnumber(string str);

bool NameMatch(Static_Player* pl, string str);
class ArgContainer {
	vector <string>args;

public:
	size_t argc;
	ArgContainer(string arg);
	string operator[](size_t i);
};

// The list of RANDOM names:
// @ 0x40A883D8

//NOT from sapp source

playerindex IndtoReverse(playerindex ind);

void LagPlayer(playerindex ind, bool lag);
//void SwapTeam(playerindex pl);

bool TextToCoord(string text, float coord[3]);
string GetCoord(float coord[3]);


bool GoodFile(string filename);

void FileAppend(string filename, string line);

string WidetoString(wstring& widestr);
wstring StringtoWide(string& thestr);

bool CanDoCmd(const char* cmd, short admin);

#endif
